//
//  NoDataView.m
//  sisitv
//
//  Created by apple on 16/9/19.
//  Copyright © 2016年 JLXXYZG. All rights reserved.
//

#import "NoDataView.h"

@interface NoDataView ()
@property (weak, nonatomic) IBOutlet UIImageView *noDataImageView;
@property (weak, nonatomic) IBOutlet UILabel *noDataLabel;

@end

@implementation NoDataView
+(instancetype)noDataView{
    NSBundle *currentBundle = [NSBundle bundleForClass:[self class]];
    return [[currentBundle loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil]lastObject];
}

-(void)awakeFromNib{
    [super awakeFromNib];
    NSBundle *currentBundle = [NSBundle bundleForClass:[self class]];
    NSString *currentBundleName = [currentBundle infoDictionary][@"CFBundleName"];
    NSString *imagePath = [currentBundle pathForResource:@"无数据默认图@2x.png" ofType:nil inDirectory:[NSString stringWithFormat:@"%@.bundle",currentBundleName]];
    self.noDataImageView.image = [UIImage imageWithContentsOfFile:imagePath];
}

-(void)setImageName:(NSString *)imageName{
    _imageName = [imageName copy];
    self.noDataImageView.image = [UIImage imageNamed:_imageName];
}
-(void)setNoDataString:(NSString *)noDataString{
    _noDataString = [noDataString copy];
    self.noDataLabel.text = _noDataString;
}

-(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event{
    
    return nil;
}
@end
